/**
 * FileName: L268
 * Author:   powersi
 * Date:     2021/3/3 16:55
 * Description:
 */
package com.zm.demo.core.leetcode;

/**
 * Description: 
 * Author:      powersi
 * Date:        2021/3/3 16:55
 */
public class L268 {

    public int missingNumber(int[] nums) {
        int sum = 0;
        int sum1 = 0;
        for (int i = 0; i < nums.length; i++) {
            sum+=nums[i];
            sum1+=(1+i);
        }
        return sum1-sum;
    }
}
